/* 
 *   Date       Developer   Description
 *   
 *
 *   Classname:  org.apache.camel.component.custom.CustomProducer
 * 
 *   Date:   2014-3-3
 * 
 *   The source code contained in this listing is proprietary to
 *   HLJ POST YITONG INFO-NET CO.,LTD.
 * 
 *   Unauthorized copying, adaptation, distribution, use, or display
 *   is strictly prohibited.
 *   This software is Copyright 2014 HLJ POST YITONG INFO-NET CO.,LTD.
 */
package com.titan.demo.camel.developers.component;

import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.impl.DefaultProducer;

import com.titan.demo.camel.utils.LogUtils;


/**
 *
 *
 * @author Administrator
 *
 */
public class CustomProducer extends DefaultProducer {
    private CustomEndpoint endpoint;
    
    
    public CustomProducer(CustomEndpoint endpoint, String uri) {
        super(endpoint);
        this.endpoint = endpoint;
        LogUtils.log(CustomProducer.class, "CustomProducer", "uri="+uri);
    }
    
    @Override
    protected void doStart() throws Exception {
        super.doStart();
    }

    @Override
    protected void doStop() throws Exception {
        super.doStop();
    }
    
    public void process(Exchange exchange) throws Exception {
        LogUtils.log(CustomProducer.class, "process");
        
        Message in = exchange.getIn();
        System.out.println("in.Headers="+in.getHeaders());
        System.out.println("in.body="+in.getBody());
        
        Message out = exchange.getOut();
        out.setBody("body_return_data");
    }
}













